#include <stdio.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
#include "Private.h"
#include "System.h"

/// <summary>
/// The ConsoleOpen function...
/// </summary>
int ConsoleOpen(void)
{
	int handle = -1;
	if ((handle = Open(CONSOLE_PATH, 2 /* O_RDWR */, 0)) < 0)
		return -1;
	Duplicate(handle);
	Duplicate(handle);
	return handle;
}

/// <summary>
/// The CloseConsole function...
/// </summary>
int CloseConsole(int handle)
{
	if (Close(handle) < 0)
		return -1; 
	return 0;
}
